package com.puc.vo;

import java.util.List;


public class Processo implements Comparable<Processo>{
	
	private String Id;
	private Integer processorTime;
	private int arrivalTime;
	private List<Operacao> IOPerations;
	private ProcessoStatus estado = ProcessoStatus.NAOCRIADO;
        private int tempoProcessoCPU = 0;
        private Operacao operacaoBloqueadora;
        private int turnAroundtime;
        private int waitingTime;
        private int blockedTime;

	public Processo(){
        
        }

	public Processo(String Id, int processorTime, int arrivalTime, List<Operacao> IOPerations){
		this.Id = Id;
		this.processorTime = processorTime;
		this.arrivalTime = arrivalTime;
		this.IOPerations = IOPerations;
                this.turnAroundtime = processorTime;
	}

	public String getId() {
		return Id;
	}

	public void setId(String id) {
		Id = id;
	}

	public int getProcessorTime() {
		return processorTime;
	}

	public void setProcessorTime(int processorTime) {
		this.processorTime = processorTime;
	}

	public int getArrivalTime() {
		return arrivalTime;
	}

	public void setArrivalTime(int arrivalTime) {
		this.arrivalTime = arrivalTime;
	}

	public List<Operacao> getIOPerations() {
		return IOPerations;
	}

	public void setIOPerations(List<Operacao> perations) {
		IOPerations = perations;
	}
	
	

	public ProcessoStatus getEstado() {
		return estado;
	}

	public void setEstado(ProcessoStatus estado) {
		this.estado = estado;
	}

	public Operacao getOperacaoBloqueadora() {
		return operacaoBloqueadora;
	}

	public void setOperacaoBloqueadora(Operacao operacao) {
		this.operacaoBloqueadora = operacao;
	}
       public int getTurnAroundTime() {
		return turnAroundtime;
	}

	public void setTurnAroundTime(int turnAroundtime) {
		this.turnAroundtime = turnAroundtime;
	}
        public int getWatingTime() {
		return waitingTime;
	}

	public void setWatingTime(int waitingTime) {
		this.waitingTime = waitingTime;
	}
        public int getBlockedTime() {
		return blockedTime;
	}

	public void setBlockedTime(int blockedTime) {
		this.blockedTime = blockedTime;
	}


	public enum ProcessoStatus {
		 
	    NAOCRIADO("NAO-CRIADO"), PRONTO("PRONTO"), EXECUTANDO("EXECUTANDO"),BLOQUEADO("BLOQUEADO"), TERMINADO("TERMINADO") ;
	    private String status;
	 
	    private ProcessoStatus(String processoStatus) {
	    this.status = processoStatus;
	    }

	     public String getProcessoStatus() {
	    return status;
	    }
	}

	@Override
	public int compareTo(Processo o) {
		// TODO Auto-generated method stub
		return processorTime.compareTo(o.getProcessorTime());
	}

        public void setTempoProcessoCPU(int tempo){

            this.tempoProcessoCPU = tempo;
        }

        public int getTempoProcessoCPU(){

            return this.tempoProcessoCPU;
        }


}
